name: Unit Tests
on: [pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Check out code repository source code
        uses: actions/checkout@v4
      - name: Set up Go
        uses: actions/setup-go@v5
        with:
          go-version-file: 'go.mod'
        id: go
      - uses: actions/cache@v4
        with:
          path: ~/go/pkg/mod
          key: ${{ runner.os }}-go${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
      - name: Vet
        run: make vet
      - name: Test
        run: make test
